Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/gh 218 nfs client #232

Merged
merged 7 commits into from
Dec 13, 2018
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}')
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion commands/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
20 changes: 17 additions & 3 deletions commands/bootstrap/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand Down
50 changes: 25 additions & 25 deletions commands/bootstrap/resources/topology/topology_ha.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
- <normative-types.yml>
- org.alien4cloud.alien4cloud.config.location/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/types.yml
- org.alien4cloud.alien4cloud.config.location/{{getAlien4CloudVersionFromTOSCATypes}}/types.yml
- <yorc-google-types.yml>
- <yorc-openstack-types.yml>
- <yorc-aws-types.yml>
- <yorc-hostspool-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
- <yorc-types.yml>
- 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:
Expand Down
44 changes: 22 additions & 22 deletions commands/bootstrap/resources/topology/topology_single_node.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
- <normative-types.yml>
- org.alien4cloud.alien4cloud.config.location/{{getAlien4CloudVersion .Alien4cloud.DownloadURL}}/types.yml
- org.alien4cloud.alien4cloud.config.location/{{getAlien4CloudVersionFromTOSCATypes}}/types.yml
- <yorc-google-types.yml>
- <yorc-openstack-types.yml>
- <yorc-aws-types.yml>
- <yorc-hostspool-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
- <yorc-types.yml>
- 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:
Expand Down
Binary file modified commands/bootstrap/resources/topology/tosca_types.zip
Binary file not shown.
14 changes: 8 additions & 6 deletions commands/bootstrap/topology.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
Expand Down
2 changes: 2 additions & 0 deletions versions.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down