]> review.fuel-infra Code Review - tools/sustaining.git/commitdiff
Make heat-templates standalone 81/41081/4
authorVladimir Khlyunev <vkhlyunev@mirantis.com>
Wed, 17 Apr 2019 12:32:18 +0000 (16:32 +0400)
committerVladimir Khlyunev <vkhlyunev@mirantis.com>
Wed, 17 Apr 2019 12:54:16 +0000 (16:54 +0400)
Change-Id: I2f81311a2499cb97a78cf7dd1b5e025a9ceef4cf

maintenance-ci/common/data/jenkins-slave.yml
maintenance-ci/common/data/mos-dev-slave.yml
maintenance-ci/common/data/mos-slave.yml

index 4843112bb42c9531776a508b3267112635362888..df56b027c862f1a5b44295e72dee1930f4a9c7f1 100644 (file)
@@ -6,22 +6,22 @@ parameters:
     type: string
     description: Name of keypair to assign to servers
     default: maintenance-ci-public-key
+    constraints:
+      - custom_constraint: nova.keypair
+        description: Must name a public key (pair) known to Nova
   image:
     type: string
     description: Name of image to use for servers
     default: maintenance-ci-base-image
+    constraints:
+      - custom_constraint: glance.image
+        description: Must identify an image known to Glance
   flavor:
     type: string
     description: Flavor to use for servers
-  private_net:
-    type: string
-    description: >
-      ID or name of public network for which floating IP addresses will be allocated
-    default: maintenance-ci-network
-  private_subnet:
-    type: string
-    default: maintenance-ci-subnet
-    description: Id of the private sub network for the compute server
+    constraints:
+      - custom_constraint: nova.flavor
+        description: Must be a flavor known to Nova
   public_net:
     type: string
     default: public
@@ -32,7 +32,6 @@ parameters:
     description: List of labels for jenkins swarm agent separated by whitespace
 
 resources:
-
   wait_condition:
     type: OS::Heat::WaitCondition
     properties:
@@ -43,14 +42,56 @@ resources:
   wait_handle:
     type: OS::Heat::WaitConditionHandle
 
+  private_net:
+    type: OS::Neutron::Net
+
+  private_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: private_net }
+      cidr: 10.10.0.0/24
+      dns_nameservers:
+        - 172.18.176.6
+        - 172.18.208.44
+
+  router:
+    type: OS::Neutron::Router
+    properties:
+      external_gateway_info:
+        network: { get_param: public_net }
+
+  router_interface:
+    type: OS::Neutron::RouterInterface
+    properties:
+      router_id: { get_resource: router }
+      subnet_id: { get_resource: private_subnet }
+
+  security_group:
+    type: OS::Neutron::SecurityGroup
+    properties:
+      rules: [
+      {direction: ingress,
+       remote_ip_prefix: 0.0.0.0/0,
+       protocol: tcp,
+       port_range_min: 1,
+       port_range_max: 65535},
+      {direction: ingress,
+       remote_ip_prefix: 0.0.0.0/0,
+       protocol: udp,
+       port_range_min: 1,
+       port_range_max: 65535},
+      {remote_ip_prefix: 0.0.0.0/0,
+       protocol: icmp,
+       direction: ingress}]
+
   public_port:
     type: OS::Neutron::Port
     properties:
-      network_id: { get_param: private_net }
+      network_id: { get_resource: private_net }
       fixed_ips:
-      - subnet_id: { get_param: private_subnet }
+      - subnet_id: { get_resource: private_subnet }
       security_groups:
-      - dc56d304-e75e-437a-8ef5-656f9bfcd2a0
+      - { get_resource: security_group }
 
   floating_ip:
     type: OS::Neutron::FloatingIP
index e08c77845498a0a683f9edb17839c5e84e0ec088..3f044b89515f810e38877cbdfd554ad14a776dfc 100644 (file)
@@ -6,22 +6,22 @@ parameters:
     type: string
     description: Name of keypair to assign to servers
     default: maintenance-ci-public-key
+    constraints:
+      - custom_constraint: nova.keypair
+        description: Must name a public key (pair) known to Nova
   image:
     type: string
     description: Name of image to use for servers
     default: maintenance-ci-mos-image
+    constraints:
+      - custom_constraint: glance.image
+        description: Must identify an image known to Glance
   flavor:
     type: string
     description: Flavor to use for servers
-  private_net:
-    type: string
-    description: >
-      ID or name of public network for which floating IP addresses will be allocated
-    default: maintenance-ci-network
-  private_subnet:
-    type: string
-    default: maintenance-ci-subnet
-    description: Id of the private sub network for the compute server
+    constraints:
+      - custom_constraint: nova.flavor
+        description: Must be a flavor known to Nova
   public_net:
     type: string
     default: public
@@ -32,7 +32,6 @@ parameters:
     description: List of labels for jenkins swarm agent separated by whitespace
 
 resources:
-
   wait_condition:
     type: OS::Heat::WaitCondition
     properties:
@@ -43,14 +42,56 @@ resources:
   wait_handle:
     type: OS::Heat::WaitConditionHandle
 
+  private_net:
+    type: OS::Neutron::Net
+
+  private_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: private_net }
+      cidr: 10.10.0.0/24
+      dns_nameservers:
+        - 172.18.176.6
+        - 172.18.208.44
+
+  router:
+    type: OS::Neutron::Router
+    properties:
+      external_gateway_info:
+        network: { get_param: public_net }
+
+  router_interface:
+    type: OS::Neutron::RouterInterface
+    properties:
+      router_id: { get_resource: router }
+      subnet_id: { get_resource: private_subnet }
+
+  security_group:
+    type: OS::Neutron::SecurityGroup
+    properties:
+      rules: [
+      {direction: ingress,
+       remote_ip_prefix: 0.0.0.0/0,
+       protocol: tcp,
+       port_range_min: 1,
+       port_range_max: 65535},
+      {direction: ingress,
+       remote_ip_prefix: 0.0.0.0/0,
+       protocol: udp,
+       port_range_min: 1,
+       port_range_max: 65535},
+      {remote_ip_prefix: 0.0.0.0/0,
+       protocol: icmp,
+       direction: ingress}]
+
   public_port:
     type: OS::Neutron::Port
     properties:
-      network_id: { get_param: private_net }
+      network_id: { get_resource: private_net }
       fixed_ips:
-      - subnet_id: { get_param: private_subnet }
+      - subnet_id: { get_resource: private_subnet }
       security_groups:
-      - dc56d304-e75e-437a-8ef5-656f9bfcd2a0
+      - { get_resource: security_group }
 
   floating_ip:
     type: OS::Neutron::FloatingIP
index 4bc88f84caa19b1a09f4ff8acc1ac8f2c2aa9227..d5884fa41a787620d662b1b25f641869e5081e12 100644 (file)
@@ -6,22 +6,22 @@ parameters:
     type: string
     description: Name of keypair to assign to servers
     default: maintenance-ci-public-key
+    constraints:
+      - custom_constraint: nova.keypair
+        description: Must name a public key (pair) known to Nova
   image:
     type: string
     description: Name of image to use for servers
     default: maintenance-ci-mos-image
+    constraints:
+      - custom_constraint: glance.image
+        description: Must identify an image known to Glance
   flavor:
     type: string
     description: Flavor to use for servers
-  private_net:
-    type: string
-    description: >
-      ID or name of public network for which floating IP addresses will be allocated
-    default: maintenance-ci-network
-  private_subnet:
-    type: string
-    default: maintenance-ci-subnet
-    description: Id of the private sub network for the compute server
+    constraints:
+      - custom_constraint: nova.flavor
+        description: Must be a flavor known to Nova
   public_net:
     type: string
     default: public
@@ -32,7 +32,6 @@ parameters:
     description: List of labels for jenkins swarm agent separated by whitespace
 
 resources:
-
   wait_condition:
     type: OS::Heat::WaitCondition
     properties:
@@ -43,14 +42,56 @@ resources:
   wait_handle:
     type: OS::Heat::WaitConditionHandle
 
+  private_net:
+    type: OS::Neutron::Net
+
+  private_subnet:
+    type: OS::Neutron::Subnet
+    properties:
+      network_id: { get_resource: private_net }
+      cidr: 10.10.0.0/24
+      dns_nameservers:
+        - 172.18.176.6
+        - 172.18.208.44
+
+  router:
+    type: OS::Neutron::Router
+    properties:
+      external_gateway_info:
+        network: { get_param: public_net }
+
+  router_interface:
+    type: OS::Neutron::RouterInterface
+    properties:
+      router_id: { get_resource: router }
+      subnet_id: { get_resource: private_subnet }
+
+  security_group:
+    type: OS::Neutron::SecurityGroup
+    properties:
+      rules: [
+      {direction: ingress,
+       remote_ip_prefix: 0.0.0.0/0,
+       protocol: tcp,
+       port_range_min: 1,
+       port_range_max: 65535},
+      {direction: ingress,
+       remote_ip_prefix: 0.0.0.0/0,
+       protocol: udp,
+       port_range_min: 1,
+       port_range_max: 65535},
+      {remote_ip_prefix: 0.0.0.0/0,
+       protocol: icmp,
+       direction: ingress}]
+
   public_port:
     type: OS::Neutron::Port
     properties:
-      network_id: { get_param: private_net }
+      network_id: { get_resource: private_net }
       fixed_ips:
-      - subnet_id: { get_param: private_subnet }
+      - subnet_id: { get_resource: private_subnet }
       security_groups:
-      - dc56d304-e75e-437a-8ef5-656f9bfcd2a0
+      - { get_resource: security_group }
 
   floating_ip:
     type: OS::Neutron::FloatingIP