-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
226 additions
and
323 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,24 @@ | ||
import tosca | ||
import unfurl | ||
from unfurl.tosca_plugins.artifacts import * | ||
from unfurl.tosca_plugins.artifacts import unfurl_nodes_Installer_Terraform | ||
import unfurl.configurators.terraform | ||
|
||
terraform_example = unfurl_nodes_Installer_Terraform( | ||
"terraform-example", | ||
) | ||
|
||
configurator_artifacts = unfurl.nodes.LocalRepository( | ||
"configurator-artifacts", | ||
_directives=["default"], | ||
) | ||
configurator_artifacts.terraform = artifact_AsdfTool( | ||
"terraform", | ||
version="1.1.4", | ||
file="terraform", | ||
) | ||
configurator_artifacts.gcloud = artifact_AsdfTool( | ||
"gcloud", | ||
version="398.0.0", | ||
file="gcloud", | ||
) | ||
configurator_artifacts.kompose = artifact_AsdfTool( | ||
"kompose", | ||
version="1.26.1", | ||
file="kompose", | ||
) | ||
configurator_artifacts.google_auth = artifact_PythonPackage( | ||
"google-auth", | ||
file="google-auth", | ||
) | ||
configurator_artifacts.octodns = artifact_PythonPackage( | ||
"octodns", | ||
version="==0.9.14", | ||
file="octodns", | ||
) | ||
configurator_artifacts.kubernetes_core = artifact_AnsibleCollection( | ||
"kubernetes.core", | ||
version="2.4.0", | ||
file="kubernetes.core", | ||
) | ||
configurator_artifacts.community_docker = artifact_AnsibleCollection( | ||
"community.docker", | ||
version="1.10.2", | ||
file="community.docker", | ||
) | ||
configurator_artifacts.ansible_utils = artifact_AnsibleCollection( | ||
"ansible.utils", | ||
version="2.10.3", | ||
file="ansible.utils", | ||
) | ||
@tosca.operation( | ||
name="default", apply_to=["Install.check", "Standard.configure", "Standard.delete"] | ||
) | ||
def terraform_example_default(**kw): | ||
return unfurl.configurators.terraform.TerraformConfigurator( | ||
tfvars={"tag": "test"}, | ||
main=""" | ||
variable "tag" { | ||
type = string | ||
} | ||
output "name" { | ||
value = var.tag | ||
}""", | ||
) | ||
|
||
|
||
terraform_example = unfurl_nodes_Installer_Terraform() | ||
terraform_example.default = terraform_example_default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apiVersion: unfurl/v1alpha1 | ||
kind: Ensemble | ||
spec: | ||
service_template: | ||
imports: | ||
- repository: unfurl | ||
file: tosca_plugins/artifacts.yaml | ||
topology_template: | ||
node_templates: | ||
|
||
terraform-example: | ||
type: unfurl.nodes.Installer.Terraform | ||
interfaces: | ||
defaults: | ||
inputs: | ||
tfvars: | ||
tag: test | ||
main: | | ||
variable "tag" { | ||
type = string | ||
} | ||
output "name" { | ||
value = var.tag | ||
} | ||
Standard: | ||
operations: | ||
configure: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: unfurl/v1alpha1 | ||
kind: Ensemble | ||
spec: | ||
service_template: | ||
imports: | ||
- repository: unfurl | ||
file: configurators/templates/docker.yaml | ||
topology_template: | ||
node_templates: | ||
hello-world-container: | ||
type: unfurl.nodes.Container.Application.Docker | ||
artifacts: | ||
image: | ||
type: tosca.artifacts.Deployment.Image.Container.Docker | ||
file: busybox | ||
interfaces: | ||
Standard: | ||
inputs: | ||
configuration: | ||
command: ["echo", "hello world"] | ||
detach: no | ||
output_logs: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
apiVersion: unfurl/v1alpha1 | ||
kind: Ensemble | ||
spec: | ||
service_template: | ||
imports: | ||
- repository: unfurl | ||
file: configurators/templates/dns.yaml | ||
topology_template: | ||
node_templates: | ||
example_com_zone: | ||
type: unfurl.nodes.DNSZone | ||
properties: | ||
name: example.com. | ||
provider: | ||
# Amazon Route53 (Note: this provider requires that the zone already exists.) | ||
class: octodns.provider.route53.Route53Provider | ||
|
||
test_app: | ||
type: tosca.nodes.WebServer | ||
requirements: | ||
- host: compute | ||
- dns: | ||
node: example_com_zone | ||
relationship: | ||
type: unfurl.relationships.DNSRecords | ||
properties: | ||
records: | ||
www: | ||
type: A | ||
value: | ||
# get the ip address of the Compute instance that this is hosted on | ||
eval: .source::.requirements::[.name=host]::.target::public_address |
Oops, something went wrong.