From da36a56d1fcf1ac472a5515ed5b89a309caeacd1 Mon Sep 17 00:00:00 2001 From: Cam Parry Date: Wed, 4 Nov 2015 13:57:06 +0000 Subject: [PATCH 1/4] Fix open urls function and wercker versions --- bootstrap/common.sh | 10 ++++++++-- wercker.yml | 6 +++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/bootstrap/common.sh b/bootstrap/common.sh index d6db0212..62ce4a08 100644 --- a/bootstrap/common.sh +++ b/bootstrap/common.sh @@ -28,7 +28,7 @@ verify_prereqs() { check_terraform_version() { local IFS='.' local current_version_string="${2:-$( terraform --version | awk 'NR==1 {print $2}' )}" - local requirement_version_string=${1:-0.6.1} + local requirement_version_string=${1:-0.6.6} local -a current_version=( ${current_version_string#'v'} ) local -a requirement_version=( ${requirement_version_string} ) local n diff @@ -69,13 +69,19 @@ get_apollo_variables() { apollo_launch() { if [ "$@" ]; then eval $@ - else + elif [[ "-i" ]]; then get_terraform_modules terraform_apply run_if_exist "ansible_ssh_config" ansible_playbook_run run_if_exist "set_vpn" open_urls + else + get_terraform_modules + terraform_apply + run_if_exist "ansible_ssh_config" + ansible_playbook_run + run_if_exist "set_vpn" fi } diff --git a/wercker.yml b/wercker.yml index 1b4a0673..84acf5c6 100644 --- a/wercker.yml +++ b/wercker.yml @@ -10,8 +10,8 @@ build: name: install packer cwd: packer/ code: | - wget https://dl.bintray.com/mitchellh/packer/packer_0.7.5_linux_amd64.zip - unzip packer_0.7.5_linux_amd64.zip + wget https://dl.bintray.com/mitchellh/packer/packer_0.8.6_linux_amd64.zip + unzip packer_0.8.6_linux_amd64.zip ./packer version - script: cwd: packer/ @@ -52,7 +52,7 @@ deploy: cloud: $CLOUD artifact_name: $ARTIFACT_NAME artifact_version: $ARTIFACT_VERSION - terraform_version: 0.6.1 + terraform_version: 0.6.6 run_tests: true after-steps: - wantedly/pretty-slack-notify: From 6d189740fefabcb4982f8986770461c5e24a2d11 Mon Sep 17 00:00:00 2001 From: Rafal B Date: Wed, 4 Nov 2015 14:05:09 +0000 Subject: [PATCH 2/4] Upgrading docker version on bastion host - issue #505 --- terraform/aws/bastion-server.tf | 8 +++++++- terraform/aws/variables.tf | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/terraform/aws/bastion-server.tf b/terraform/aws/bastion-server.tf index 5baeef95..6ed2204c 100644 --- a/terraform/aws/bastion-server.tf +++ b/terraform/aws/bastion-server.tf @@ -36,7 +36,13 @@ resource "aws_instance" "bastion" { "sudo iptables -t nat -A POSTROUTING -j MASQUERADE", "echo 1 | sudo tee /proc/sys/net/ipv4/conf/all/forwarding", /* Install docker */ - "curl -sSL https://get.docker.com/ubuntu/ | sudo sh", + /* Add the repository to your APT sources */ + "sudo -E sh -c 'echo deb https://apt.dockerproject.org/repo ubuntu-trusty main > /etc/apt/sources.list.d/docker.list'", + /* Then import the repository key */ + "sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D", + "sudo apt-get update", + /* Install docker-engine */ + "sudo apt-get install -y docker-engine=${var.docker_version}", "sudo service docker start", /* Initialize open vpn data container */ "sudo mkdir -p /etc/openvpn", diff --git a/terraform/aws/variables.tf b/terraform/aws/variables.tf index 749ef4c4..199808f8 100644 --- a/terraform/aws/variables.tf +++ b/terraform/aws/variables.tf @@ -109,3 +109,8 @@ variable "amis" { us-west-2 = "ami-00657261" } } + +variable "docker_version" { + description = "Docker version" + default = "1.8.2-0~trusty" +} From c3776d0ceafd9447be4a3c752440a6c3cb8657a3 Mon Sep 17 00:00:00 2001 From: Cam Parry Date: Wed, 4 Nov 2015 15:05:59 +0000 Subject: [PATCH 3/4] add flag for open urls --- bootstrap/common.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bootstrap/common.sh b/bootstrap/common.sh index 62ce4a08..74ec06e0 100644 --- a/bootstrap/common.sh +++ b/bootstrap/common.sh @@ -67,15 +67,15 @@ get_apollo_variables() { } apollo_launch() { - if [ "$@" ]; then - eval $@ - elif [[ "-i" ]]; then + if [[ "$@" == "-i" ]]; then get_terraform_modules terraform_apply run_if_exist "ansible_ssh_config" ansible_playbook_run run_if_exist "set_vpn" open_urls + elif [ "$@" ]; then + eval $@ else get_terraform_modules terraform_apply From 32d7188c12fdeed4d036b8c82a74bd8b8fc9cf8d Mon Sep 17 00:00:00 2001 From: enxebre Date: Wed, 4 Nov 2015 15:21:28 +0000 Subject: [PATCH 4/4] Bump Docker 1.9.0 and Docker-py 1.5.0 --- packer/scripts/ubuntu/install_docker.sh | 2 +- packer/tests/spec/docker_spec.rb | 2 +- packer/ubuntu-14.04_amd64-amis.json | 2 +- packer/ubuntu-14.04_amd64-droplet.json | 2 +- packer/ubuntu-14.04_amd64-google.json | 2 +- packer/ubuntu-14.04_amd64.json | 2 +- terraform/aws-public/variables.tf | 18 ++++++++-------- terraform/aws/variables.tf | 28 ++++++++++++------------- 8 files changed, 29 insertions(+), 29 deletions(-) diff --git a/packer/scripts/ubuntu/install_docker.sh b/packer/scripts/ubuntu/install_docker.sh index 2c033cf0..d98ce3d6 100755 --- a/packer/scripts/ubuntu/install_docker.sh +++ b/packer/scripts/ubuntu/install_docker.sh @@ -4,7 +4,7 @@ set -o pipefail sudo apt-get -y update -sudo pip install docker-py==1.3.1 +sudo pip install docker-py==1.5.0 sudo apt-get install -y linux-image-extra-$(uname -r) diff --git a/packer/tests/spec/docker_spec.rb b/packer/tests/spec/docker_spec.rb index b39cef5c..f452eb9b 100644 --- a/packer/tests/spec/docker_spec.rb +++ b/packer/tests/spec/docker_spec.rb @@ -9,7 +9,7 @@ end describe package('docker-py') do - it { should be_installed.by('pip').with_version('1.3.1') } + it { should be_installed.by('pip').with_version('1.5.0') } end describe package("linux-image-extra-#{`uname -r`.strip}") do diff --git a/packer/ubuntu-14.04_amd64-amis.json b/packer/ubuntu-14.04_amd64-amis.json index 4ba7a65d..c42bb2f2 100644 --- a/packer/ubuntu-14.04_amd64-amis.json +++ b/packer/ubuntu-14.04_amd64-amis.json @@ -6,7 +6,7 @@ "marathon_version": "v0.10.1", "consul_version": "0.5.2", "weave_version": "1.2.0", - "docker_version": "1.8.2-0~trusty", + "docker_version": "1.9.0-0~trusty", "version": "{{env `APOLLO_VERSION`}}", "aws_region": "{{env `AWS_REGION`}}", "aws_source_ami": "{{env `AWS_SOURCE_AMI`}}", diff --git a/packer/ubuntu-14.04_amd64-droplet.json b/packer/ubuntu-14.04_amd64-droplet.json index 7a392c2f..703d9386 100644 --- a/packer/ubuntu-14.04_amd64-droplet.json +++ b/packer/ubuntu-14.04_amd64-droplet.json @@ -8,7 +8,7 @@ "marathon_version": "v0.10.1", "consul_version": "0.5.2", "weave_version": "1.2.0", - "docker_version": "1.8.2-0~trusty", + "docker_version": "1.9.0-0~trusty", "version": "{{env `APOLLO_VERSION`}}" }, "builders": [{ diff --git a/packer/ubuntu-14.04_amd64-google.json b/packer/ubuntu-14.04_amd64-google.json index 8f3cac42..a5a54cad 100644 --- a/packer/ubuntu-14.04_amd64-google.json +++ b/packer/ubuntu-14.04_amd64-google.json @@ -8,7 +8,7 @@ "marathon_version": "v0.10.1", "consul_version": "0.5.2", "weave_version": "1.2.0", - "docker_version": "1.8.2-0~trusty", + "docker_version": "1.9.0-0~trusty", "version": "{{env `APOLLO_VERSION`}}" }, "builders": [{ diff --git a/packer/ubuntu-14.04_amd64.json b/packer/ubuntu-14.04_amd64.json index 34cf4c40..1d9f1149 100644 --- a/packer/ubuntu-14.04_amd64.json +++ b/packer/ubuntu-14.04_amd64.json @@ -12,7 +12,7 @@ "marathon_version": "v0.10.1", "consul_version": "0.5.2", "weave_version": "1.2.0", - "docker_version": "1.8.2-0~trusty", + "docker_version": "1.9.0-0~trusty", "access_token": "{{env `ATLAS_TOKEN`}}", "iso_url": "http://releases.ubuntu.com/trusty/ubuntu-14.04.3-server-amd64.iso", "iso_checksum": "9e5fecc94b3925bededed0fdca1bd417" diff --git a/terraform/aws-public/variables.tf b/terraform/aws-public/variables.tf index 7f6bdc13..682b8bf9 100644 --- a/terraform/aws-public/variables.tf +++ b/terraform/aws-public/variables.tf @@ -84,14 +84,14 @@ variable "atlas_artifact_version" { /* Remember to update the list every time when you build a new artifact on atlas */ variable "amis" { default = { - ap-northeast-1 = "ami-75dcf81b" - ap-southeast-1 = "ami-7324e310" - ap-southeast-2 = "ami-a60c52c5" - eu-central-1 = "ami-950b18f9" - eu-west-1 = "ami-f603dd85" - sa-east-1 = "ami-da962db6" - us-east-1 = "ami-be106dd4" - us-west-1 = "ami-7b046b1b" - us-west-2 = "ami-00657261" + ap-northeast-1 = "ami-3f6a4d51" + ap-southeast-1 = "ami-1e3cfb7d" + ap-southeast-2 = "ami-ca326ca9" + eu-central-1 = "ami-de392ab2" + eu-west-1 = "ami-4972ac3a" + sa-east-1 = "ami-7076cd1c" + us-east-1 = "ami-48ef9222" + us-west-1 = "ami-54610e34" + us-west-2 = "ami-cb3b2caa" } } diff --git a/terraform/aws/variables.tf b/terraform/aws/variables.tf index 199808f8..5575e7cd 100644 --- a/terraform/aws/variables.tf +++ b/terraform/aws/variables.tf @@ -95,22 +95,22 @@ variable "atlas_artifact_version" { } } +variable "docker_version" { + description = "Docker version" + default = "1.8.2-0~trusty" +} + /* Remember to update the list every time when you build a new artifact on atlas */ variable "amis" { default = { - ap-northeast-1 = "ami-75dcf81b" - ap-southeast-1 = "ami-7324e310" - ap-southeast-2 = "ami-a60c52c5" - eu-central-1 = "ami-950b18f9" - eu-west-1 = "ami-f603dd85" - sa-east-1 = "ami-da962db6" - us-east-1 = "ami-be106dd4" - us-west-1 = "ami-7b046b1b" - us-west-2 = "ami-00657261" + ap-northeast-1 = "ami-3f6a4d51" + ap-southeast-1 = "ami-1e3cfb7d" + ap-southeast-2 = "ami-ca326ca9" + eu-central-1 = "ami-de392ab2" + eu-west-1 = "ami-4972ac3a" + sa-east-1 = "ami-7076cd1c" + us-east-1 = "ami-48ef9222" + us-west-1 = "ami-54610e34" + us-west-2 = "ami-cb3b2caa" } } - -variable "docker_version" { - description = "Docker version" - default = "1.8.2-0~trusty" -}