diff --git a/.gitignore b/.gitignore index adc35045..54e6801b 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ inventory/terraform.py tests/spec/*/*runtime_spec.rb contrib-plugins/* terraform/*/.terraform +terraform/azure/ssh_thumbprint diff --git a/bootstrap/common.sh b/bootstrap/common.sh index 9aed409c..93896dd7 100644 --- a/bootstrap/common.sh +++ b/bootstrap/common.sh @@ -3,8 +3,7 @@ # Util functions cloud reusable. APOLLO_ROOT=$(dirname "${BASH_SOURCE}")/.. DEFAULT_CONFIG="${APOLLO_ROOT}/bootstrap/${APOLLO_PROVIDER}/${APOLLO_CONFIG_FILE-"config-default.sh"}" -# It must be change before mergeing with capgemini master branch -DYNAMIC_INVENTORY="https://raw.githubusercontent.com/ravbaba/terraform.py/azure-provider/terraform.py" +DYNAMIC_INVENTORY="https://raw.githubusercontent.com/Capgemini/terraform.py/master/terraform.py" if [ -f "${DEFAULT_CONFIG}" ]; then source "${DEFAULT_CONFIG}" diff --git a/packer/packer-azure_Ubuntu_serv14.json b/packer/packer-azure_Ubuntu_serv14.json deleted file mode 100644 index ab5de974..00000000 --- a/packer/packer-azure_Ubuntu_serv14.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "variables": { - "azure_subscription_name": "{{env `AZURE_SUBSCRIPTION_NAME`}}", - "azure_settings_file": "{{env `AZURE_SETTINGS_FILE`}}", - "azure_storage_account": "{{env `AZURE_STORAGE_ACCOUNT`}}", - "azure_instance_type": "{{env `AZURE_INSTANCE_TYPE`}}", - "azure_location": "{{env `AZURE_LOCATION`}}", - "azure_storage_container": "{{env `AZURE_STORAGE_CONTAINER`}}", - "azure_source_image": "{{env `AZURE_SOURCE_IMAGE`}}", - "mesos_version": "0.23.0-1.0.ubuntu1404", - "marathon_version": "v0.10.1", - "consul_version": "0.5.2", - "weave_version": "v1.1.0", - "docker_version": "1.8.2-0~trusty" - }, - "builders": [{ - "type": "azure", - "publish_settings_path": "{{user `azure_settings_file`}}", - "subscription_name": "{{user `azure_subscription_name`}}", - "storage_account": "{{user `azure_storage_account`}}", - "storage_account_container": "{{user `azure_storage_container`}}", - "os_type": "Linux", - "os_image_label": "{{user `azure_source_image`}}", - "location": "{{user `azure_location`}}", - "instance_size": "{{user `azure_instance_type`}}", - "user_image_label": "PackerMade_Ubuntu_Serv14-{{timestamp}}" - }], - "provisioners": [ - { - "type": "file", - "source": "scripts/ubuntu/upstart/", - "destination": "/tmp" - }, - { - "type": "shell", - "environment_vars": [ - "CONSUL_VERSION={{user `consul_version`}}", - "WEAVE_VERSION={{user `weave_version`}}", - "MESOS_VERSION={{user `mesos_version`}}", - "MARATHON_VERSION={{user `marathon_version`}}", - "DOCKER_VERSION={{user `docker_version`}}" - ], - "scripts": [ - "scripts/ubuntu/base.sh", - "scripts/common/sshd.sh", - "scripts/ubuntu/install_docker.sh", - "scripts/common/install_consul.sh", - "scripts/common/install_weave.sh" - ], - "execute_command": "{{ .Vars }} sudo -E -S bash -c '{{ .Path }}'" - } - ] -} diff --git a/terraform/azure/mesos-masters.tf b/terraform/azure/mesos-masters.tf index f57983be..c7e4a4bf 100644 --- a/terraform/azure/mesos-masters.tf +++ b/terraform/azure/mesos-masters.tf @@ -20,9 +20,9 @@ resource "azure_instance" "mesos-master" { image = "${var.atlas_artifact.master}" size = "${var.instance_type.master}" storage_service_name = "${azure_storage_service.azure_mesos_storage.name}" + security_group = "${azure_security_group.default.name}" virtual_network = "${azure_virtual_network.public.name}" subnet = "public-network-subnet" - security_group = "${azure_security_group.default.name}" location = "${var.region}" username = "${var.username}" ssh_key_thumbprint = "${file("ssh_thumbprint")}" diff --git a/terraform/azure/mesos-slaves.tf b/terraform/azure/mesos-slaves.tf index d14e458c..12bcdeef 100644 --- a/terraform/azure/mesos-slaves.tf +++ b/terraform/azure/mesos-slaves.tf @@ -20,9 +20,9 @@ resource "azure_instance" "mesos-slave" { image = "${var.atlas_artifact.slave}" size = "${var.instance_type.slave}" storage_service_name = "${azure_storage_service.azure_mesos_storage.name}" + security_group = "${azure_security_group.default.name}" virtual_network = "${azure_virtual_network.public.name}" subnet = "public-network-subnet" - security_group = "${azure_security_group.default.name}" location = "${var.region}" username = "${var.username}" ssh_key_thumbprint = "${file("ssh_thumbprint")}" diff --git a/terraform/azure/provider.tf b/terraform/azure/provider.tf index 0086ebff..baaddc55 100644 --- a/terraform/azure/provider.tf +++ b/terraform/azure/provider.tf @@ -1,3 +1,3 @@ provider "azure" { - settings_file = "${var.azure_settings_file}" + settings_file = "${file(var.azure_settings_file)}" }