Make deployed-server OS::Neutron::Port optional
authorDan Prince <dprince@redhat.com>
Sat, 6 Aug 2016 15:08:05 +0000 (11:08 -0400)
committerDan Prince <dprince@redhat.com>
Sun, 7 Aug 2016 11:29:06 +0000 (07:29 -0400)
This patch makes it possible to set
OS::TripleO::DeployedServer::ControlPlanePort: OS::Heat::None
in your resource_registry and thereby avoid the creation of
a neutron port for the deployed server. This is useful if
you are bootstrapping things in an environment without
Neutron.

Also, includes a new deployed-server-noop-ctlplane.yaml
environment file.

Change-Id: I2990dc816698e0f6e3193a8fc7c9c6767c6e50e5

deployed-server/ctlplane-port.yaml [new file with mode: 0644]
deployed-server/deployed-server.yaml
environments/deployed-server-environment.yaml
environments/deployed-server-noop-ctlplane.yaml [new file with mode: 0644]

diff --git a/deployed-server/ctlplane-port.yaml b/deployed-server/ctlplane-port.yaml
new file mode 100644 (file)
index 0000000..eb10fba
--- /dev/null
@@ -0,0 +1,23 @@
+heat_template_version: 2014-10-16
+
+parameters:
+  Hostname:
+    type: string
+
+resources:
+
+  ControlPlanePort:
+    type: OS::Neutron::Port
+    properties:
+      network: ctlplane
+      name:
+        list_join:
+          - '-'
+          - - {get_param: Hostname}
+            - ctlplane
+            - port
+      replacement_policy: AUTO
+
+outputs:
+  ip_address:
+    value: {get_attr: [ControlPlanePort, fixed_ips, 0, ip_address]}
index 8194104..da5698e 100644 (file)
@@ -94,16 +94,9 @@ resources:
       server: {get_resource: deployed-server}
 
   ControlPlanePort:
-    type: OS::Neutron::Port
+    type: OS::TripleO::DeployedServer::ControlPlanePort
     properties:
-      network: ctlplane
-      name:
-        list_join:
-          - '-'
-          - - {get_attr: [HostsEntryDeployment, hostname]}
-            - ctlplane
-            - port
-      replacement_policy: AUTO
+      Hostname: {get_attr: [HostsEntryDeployment, hostname]}
 
 outputs:
   # FIXME(shardy) this is needed because TemplateResource returns an
@@ -113,7 +106,7 @@ outputs:
   networks:
     value:
       ctlplane:
-        - {get_attr: [ControlPlanePort, fixed_ips, 0, ip_address]}
+        - {get_attr: [ControlPlanePort, ip_address]}
   name:
    value: {get_attr: [HostsEntryDeployment, hostname]}
   hosts_entry:
index 3c9e345..c63d399 100644 (file)
@@ -1,3 +1,4 @@
 resource_registry:
   OS::TripleO::Server: ../deployed-server/deployed-server.yaml
   OS::TripleO::DeployedServerConfig: ../deployed-server/deployed-server-config.yaml
+  OS::TripleO::DeployedServer::ControlPlanePort: ../deployed-server/ctlplane-port.yaml
diff --git a/environments/deployed-server-noop-ctlplane.yaml b/environments/deployed-server-noop-ctlplane.yaml
new file mode 100644 (file)
index 0000000..cfda314
--- /dev/null
@@ -0,0 +1,4 @@
+resource_registry:
+  OS::TripleO::Server: ../deployed-server/deployed-server.yaml
+  OS::TripleO::DeployedServerConfig: ../deployed-server/deployed-server-config.yaml
+  OS::TripleO::DeployedServer::ControlPlanePort: OS::Heat::None