diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e7a22da2..a00437d57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ * Generate Alien 2.1-compatible events ([GH-148](https://github.com/ystia/yorc/issues/148)) +### BUG FIXES + +* Bootstrap of HA setup fails on GCP, at step configuring the NFS Client component [GH-218](https://github.com/ystia/yorc/issues/218)) + ## 3.1.0-M7 (December 07, 2018) ### DEPENDENCIES diff --git a/Makefile b/Makefile index 4d4b6dce7..809c09d96 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,7 @@ VERSION:=$(if $(BUILD_TAG),$(VERSION)+$(BUILD_TAG),$(VERSION)) COMMIT_HASH=$(shell git rev-parse HEAD) ANSIBLE_VERSION=$(shell grep "ansible_version" versions.yaml | awk '{print $$2}') CONSUL_VERSION=$(shell grep "consul_version" versions.yaml | awk '{print $$2}') +ALIEN4CLOUD_VERSION=$(shell grep "alien4cloud_version" versions.yaml | awk '{print $$2}') TERRAFORM_VERSION=$(shell grep "terraform_version" versions.yaml | awk '{print $$2}') TF_CONSUL_PLUGIN_VERSION=$(shell grep "tf_consul_plugin_version" versions.yaml | awk '{print $$2}') TF_AWS_PLUGIN_VERSION=$(shell grep "tf_aws_plugin_version" versions.yaml | awk '{print $$2}') @@ -40,6 +41,7 @@ build: test -X github.com/ystia/yorc/commands.TfGooglePluginVersion=$(TF_GOOGLE_PLUGIN_VERSION) \ -X github.com/ystia/yorc/commands/bootstrap.ansibleVersion=$(ANSIBLE_VERSION) \ -X github.com/ystia/yorc/commands/bootstrap.consulVersion=$(CONSUL_VERSION) \ + -X github.com/ystia/yorc/commands/bootstrap.alien4cloudVersion=$(ALIEN4CLOUD_VERSION) \ -X github.com/ystia/yorc/commands/bootstrap.terraformVersion=$(TERRAFORM_VERSION) \ -X github.com/ystia/yorc/commands/bootstrap.yorcVersion=$(YORC_VERSION)" @rm -f ./build/bootstrapResources.zip diff --git a/commands/bootstrap/bootstrap.go b/commands/bootstrap/bootstrap.go index 8b26e5089..58feeff9c 100644 --- a/commands/bootstrap/bootstrap.go +++ b/commands/bootstrap/bootstrap.go @@ -28,7 +28,7 @@ import ( // Variables with an uknown values are initialized in the root Makefile var ( - alien4cloudVersion = getAlien4CloudVersionFromTOSCATypes() + alien4cloudVersion = "unknown" ansibleVersion = "unknown" consulVersion = "unknown" terraformVersion = "unknown" diff --git a/commands/bootstrap/resources.go b/commands/bootstrap/resources.go index 5e7150f8b..ec1cfde7b 100644 --- a/commands/bootstrap/resources.go +++ b/commands/bootstrap/resources.go @@ -106,9 +106,23 @@ func extractResources(resourcesZipFilePath, resourcesDir string) error { return nil } -// getAlien4CloudDefaultVersion returns the ALien4Cloud version from the bundled -// resources zip file containing TOSCA types needed for the bootstrap +// getAlien4CloudVersionFromTOSCATypes returns the ALien4Cloud version from the +// bundled resources zip file containing TOSCA types needed for the bootstrap func getAlien4CloudVersionFromTOSCATypes() string { + + return getVersionFromTOSCATypes("alien-base-types") +} + +// getForgeDefaultVersion returns the Forge version from the bundled +// resources zip file containing TOSCA types needed for the bootstrap +func getForgeVersionFromTOSCATypes() string { + + return getVersionFromTOSCATypes("org.ystia.yorc.pub") +} + +// getVersionFromTOSCATypes returns the version from the bundled +// resources zip file containing TOSCA types needed for the bootstrap +func getVersionFromTOSCATypes(path string) string { // Use the embedded resources version := "unknown" exePath, err := resources.ExecutablePath() @@ -130,7 +144,7 @@ func getAlien4CloudVersionFromTOSCATypes() string { return version } - re := regexp.MustCompile(`alien-base-types/([0-9a-zA-Z.-]+)/`) + re := regexp.MustCompile(path + "/" + `([0-9a-zA-Z.-]+)/`) for _, resource := range allResources { if !strings.HasSuffix(resource.Path(), "tosca_types.zip") { continue diff --git a/commands/bootstrap/resources/topology/topology_ha.tmpl b/commands/bootstrap/resources/topology/topology_ha.tmpl index 178857e56..3d84caa21 100644 --- a/commands/bootstrap/resources/topology/topology_ha.tmpl +++ b/commands/bootstrap/resources/topology/topology_ha.tmpl @@ -8,37 +8,37 @@ metadata: description: "" imports: - - alien-base-types/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/alien-base-types.yml - - org.ystia.nfs.linux.ansible/2.1.0-SNAPSHOT/types.yaml + - alien-base-types/{{getAlien4CloudVersionFromTOSCATypes}}/alien-base-types.yml + - org.ystia.nfs.linux.ansible/{{getForgeVersionFromTOSCATypes}}/types.yaml - - - org.alien4cloud.alien4cloud.config.location/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/types.yml + - org.alien4cloud.alien4cloud.config.location/{{getAlien4CloudVersionFromTOSCATypes}}/types.yml - - - - - - org.ystia.yorc.experimental.consul.linux.ansible/2.1.0-SNAPSHOT/types.yaml - - org.alien4cloud.elasticsearch.pub/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/types.yml - - org.ystia.terraform.linux.terraform/2.1.0-SNAPSHOT/types.yaml - - org.alien4cloud.java.jmx.jolokia/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/types.yml - - org.alien4cloud.consul.pub/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/types.yml - - org.ystia.yorc.linux.ansible/2.1.0-SNAPSHOT/types.yaml - - org.ystia.nfs.pub/2.1.0-SNAPSHOT/types.yaml + - org.ystia.yorc.experimental.consul.linux.ansible/{{getForgeVersionFromTOSCATypes}}/types.yaml + - org.alien4cloud.elasticsearch.pub/{{getAlien4CloudVersionFromTOSCATypes}}/types.yml + - org.ystia.terraform.linux.terraform/{{getForgeVersionFromTOSCATypes}}/types.yaml + - org.alien4cloud.java.jmx.jolokia/{{getAlien4CloudVersionFromTOSCATypes}}/types.yml + - org.alien4cloud.consul.pub/{{getAlien4CloudVersionFromTOSCATypes}}/types.yml + - org.ystia.yorc.linux.ansible/{{getForgeVersionFromTOSCATypes}}/types.yaml + - org.ystia.nfs.pub/{{getForgeVersionFromTOSCATypes}}/types.yaml - - - org.alien4cloud.java.pub/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/types.yml - - org.ystia.yorc.pub/2.1.0-SNAPSHOT/types.yaml - - org.alien4cloud.alien4cloud.config.location_resources.on_demand/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/types.yml - - org.alien4cloud.alien4cloud.config.location_resources.autoconfig/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/types.yml - - org.ystia.yorc.experimental.consul.pub/2.1.0-SNAPSHOT/types.yaml - - org.ystia.ansible.linux.ansible/2.1.0-SNAPSHOT/types.yaml - - org.alien4cloud.alien4cloud.pub/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/types.yml - - org.alien4cloud.alien4cloud.webapp/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/types.yml - - org.ystia.yorc.alien4cloud/2.1.0-SNAPSHOT/types.yaml - - org.alien4cloud.java.jdk.linux/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/types.yml - - org.alien4cloud.alien4cloud.config.pub/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/types.yml - - org.alien4cloud.cloudify.hostpool.pub/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/types.yml - - alien-extended-storage-types/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/alien-extended-storage-types.yml - - org.ystia.terraform.pub/2.1.0-SNAPSHOT/types.yaml - - org.ystia.ansible.pub/2.1.0-SNAPSHOT/types.yaml + - org.alien4cloud.java.pub/{{getAlien4CloudVersionFromTOSCATypes}}/types.yml + - org.ystia.yorc.pub/{{getForgeVersionFromTOSCATypes}}/types.yaml + - org.alien4cloud.alien4cloud.config.location_resources.on_demand/{{getAlien4CloudVersionFromTOSCATypes}}/types.yml + - org.alien4cloud.alien4cloud.config.location_resources.autoconfig/{{getAlien4CloudVersionFromTOSCATypes}}/types.yml + - org.ystia.yorc.experimental.consul.pub/{{getForgeVersionFromTOSCATypes}}/types.yaml + - org.ystia.ansible.linux.ansible/{{getForgeVersionFromTOSCATypes}}/types.yaml + - org.alien4cloud.alien4cloud.pub/{{getAlien4CloudVersionFromTOSCATypes}}/types.yml + - org.alien4cloud.alien4cloud.webapp/{{getAlien4CloudVersionFromTOSCATypes}}/types.yml + - org.ystia.yorc.alien4cloud/{{getForgeVersionFromTOSCATypes}}/types.yaml + - org.alien4cloud.java.jdk.linux/{{getAlien4CloudVersionFromTOSCATypes}}/types.yml + - org.alien4cloud.alien4cloud.config.pub/{{getAlien4CloudVersionFromTOSCATypes}}/types.yml + - org.alien4cloud.cloudify.hostpool.pub/{{getAlien4CloudVersionFromTOSCATypes}}/types.yml + - alien-extended-storage-types/{{getAlien4CloudVersionFromTOSCATypes}}/alien-extended-storage-types.yml + - org.ystia.terraform.pub/{{getForgeVersionFromTOSCATypes}}/types.yaml + - org.ystia.ansible.pub/{{getForgeVersionFromTOSCATypes}}/types.yaml topology_template: node_templates: diff --git a/commands/bootstrap/resources/topology/topology_single_node.tmpl b/commands/bootstrap/resources/topology/topology_single_node.tmpl index bd32951f1..81daa552e 100644 --- a/commands/bootstrap/resources/topology/topology_single_node.tmpl +++ b/commands/bootstrap/resources/topology/topology_single_node.tmpl @@ -8,34 +8,34 @@ metadata: description: "" imports: - - alien-base-types/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/alien-base-types.yml + - alien-base-types/{{getAlien4CloudVersionFromTOSCATypes}}/alien-base-types.yml - - - org.alien4cloud.alien4cloud.config.location/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/types.yml + - org.alien4cloud.alien4cloud.config.location/{{getAlien4CloudVersionFromTOSCATypes}}/types.yml - - - - - - org.ystia.yorc.experimental.consul.linux.ansible/2.1.0-SNAPSHOT/types.yaml - - org.alien4cloud.elasticsearch.pub/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/types.yml - - org.ystia.terraform.linux.terraform/2.1.0-SNAPSHOT/types.yaml - - org.alien4cloud.java.jmx.jolokia/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/types.yml - - org.alien4cloud.consul.pub/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/types.yml - - org.ystia.yorc.linux.ansible/2.1.0-SNAPSHOT/types.yaml + - org.ystia.yorc.experimental.consul.linux.ansible/{{getForgeVersionFromTOSCATypes}}/types.yaml + - org.alien4cloud.elasticsearch.pub/{{getAlien4CloudVersionFromTOSCATypes}}/types.yml + - org.ystia.terraform.linux.terraform/{{getForgeVersionFromTOSCATypes}}/types.yaml + - org.alien4cloud.java.jmx.jolokia/{{getAlien4CloudVersionFromTOSCATypes}}/types.yml + - org.alien4cloud.consul.pub/{{getAlien4CloudVersionFromTOSCATypes}}/types.yml + - org.ystia.yorc.linux.ansible/{{getForgeVersionFromTOSCATypes}}/types.yaml - - - org.alien4cloud.java.pub/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/types.yml - - org.ystia.yorc.pub/2.1.0-SNAPSHOT/types.yaml - - org.alien4cloud.alien4cloud.config.location_resources.on_demand/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/types.yml - - org.alien4cloud.alien4cloud.config.location_resources.autoconfig/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/types.yml - - org.ystia.yorc.experimental.consul.pub/2.1.0-SNAPSHOT/types.yaml - - org.ystia.ansible.linux.ansible/2.1.0-SNAPSHOT/types.yaml - - org.alien4cloud.alien4cloud.pub/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/types.yml - - org.alien4cloud.alien4cloud.webapp/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/types.yml - - org.ystia.yorc.alien4cloud/2.1.0-SNAPSHOT/types.yaml - - org.alien4cloud.java.jdk.linux/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/types.yml - - org.alien4cloud.alien4cloud.config.pub/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/types.yml - - org.alien4cloud.cloudify.hostpool.pub/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/types.yml - - org.ystia.terraform.pub/2.1.0-SNAPSHOT/types.yaml - - org.ystia.ansible.pub/2.1.0-SNAPSHOT/types.yaml + - org.alien4cloud.java.pub/{{getAlien4CloudVersionFromTOSCATypes}}/types.yml + - org.ystia.yorc.pub/{{getForgeVersionFromTOSCATypes}}/types.yaml + - org.alien4cloud.alien4cloud.config.location_resources.on_demand/{{getAlien4CloudVersionFromTOSCATypes}}/types.yml + - org.alien4cloud.alien4cloud.config.location_resources.autoconfig/{{getAlien4CloudVersionFromTOSCATypes}}/types.yml + - org.ystia.yorc.experimental.consul.pub/{{getForgeVersionFromTOSCATypes}}/types.yaml + - org.ystia.ansible.linux.ansible/{{getForgeVersionFromTOSCATypes}}/types.yaml + - org.alien4cloud.alien4cloud.pub/{{getAlien4CloudVersionFromTOSCATypes}}/types.yml + - org.alien4cloud.alien4cloud.webapp/{{getAlien4CloudVersionFromTOSCATypes}}/types.yml + - org.ystia.yorc.alien4cloud/{{getForgeVersionFromTOSCATypes}}/types.yaml + - org.alien4cloud.java.jdk.linux/{{getAlien4CloudVersionFromTOSCATypes}}/types.yml + - org.alien4cloud.alien4cloud.config.pub/{{getAlien4CloudVersionFromTOSCATypes}}/types.yml + - org.alien4cloud.cloudify.hostpool.pub/{{getAlien4CloudVersionFromTOSCATypes}}/types.yml + - org.ystia.terraform.pub/{{getForgeVersionFromTOSCATypes}}/types.yaml + - org.ystia.ansible.pub/{{getForgeVersionFromTOSCATypes}}/types.yaml topology_template: node_templates: diff --git a/commands/bootstrap/resources/topology/tosca_types.zip b/commands/bootstrap/resources/topology/tosca_types.zip index 64c3cfb15..4f44b4adb 100644 Binary files a/commands/bootstrap/resources/topology/tosca_types.zip and b/commands/bootstrap/resources/topology/tosca_types.zip differ diff --git a/commands/bootstrap/topology.go b/commands/bootstrap/topology.go index 91487e335..63b5d9be2 100644 --- a/commands/bootstrap/topology.go +++ b/commands/bootstrap/topology.go @@ -281,12 +281,14 @@ func createFileFromTemplates(templateFileNames []string, templateName, resultFil // Mapping from names to functions of functions referenced in templates fmap := template.FuncMap{ - "formatAsYAML": formatAsYAML, - "formatOnDemandResourceCredsAsYAML": formatOnDemandResourceCredsAsYAML, - "indent": indent, - "getFile": getFile, - "getRepositoryURL": getRepositoryURL, - "getAlien4CloudVersion": getAlien4CloudVersion, + "formatAsYAML": formatAsYAML, + "formatOnDemandResourceCredsAsYAML": formatOnDemandResourceCredsAsYAML, + "indent": indent, + "getFile": getFile, + "getRepositoryURL": getRepositoryURL, + "getAlien4CloudVersion": getAlien4CloudVersion, + "getAlien4CloudVersionFromTOSCATypes": getAlien4CloudVersionFromTOSCATypes, + "getForgeVersionFromTOSCATypes": getForgeVersionFromTOSCATypes, } parsedTemplate, err := template.New(templateName).Funcs(fmap).ParseFiles(templateFileNames...) diff --git a/versions.yaml b/versions.yaml index f8d4c288a..d1199c8a9 100644 --- a/versions.yaml +++ b/versions.yaml @@ -1,4 +1,6 @@ yorc_version: 3.1.0-SNAPSHOT +# Alien4Cloud version used by the bootstrap as the default version to download/install +alien4cloud_version: 2.1.0-RC1 consul_version: 1.2.3 terraform_version: 0.11.8 ansible_version: 2.7.2